#ifndef DEEPSEEKAPI_H
#define DEEPSEEKAPI_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>

class DeepSeekAPI : public QObject
{
    Q_OBJECT

public:
    explicit DeepSeekAPI(QObject *parent = nullptr);
    ~DeepSeekAPI();

    // 发送问题到DeepSeek API
    void askQuestion(const QString &question);

signals:
    // 当收到回答时发出信号
    void responseReceived(const QString &answer);
    // 发生错误时发出信号
    void errorOccurred(const QString &errorMessage);

private slots:
    // 处理网络回复
    void handleNetworkReply(QNetworkReply *reply);

private:
    QNetworkAccessManager *networkManager;
    QString apiKey;
    QString apiEndpoint;

    // 加载API密钥
    void loadApiKey();
};

#endif // DEEPSEEKAPI_H